﻿using System.Xml;
using Basic.WxGatewayModular.Interface;
using Basic.WxGatewayModular.Model;
using WeDonekRpc.ApiGateway.Attr;
using WeDonekRpc.HttpApiGateway;
using WeDonekRpc.HttpApiGateway.Interface;
using WeDonekRpc.HttpApiGateway.Response;

namespace Basic.WxGatewayModular.Api
{
    internal class WxMsgApi : ApiController
    {
        private readonly IWxMsgService _Service;

        public WxMsgApi (IWxMsgService service)
        {
            this._Service = service;
        }

        [ApiPrower(false)]
        [ApiRouteName("/wx/msg/{appId}/{platformAppId}")]
        public IResponse Notice (XmlDocument xml, [ApiGet] WxMsgParam query)
        {
            this._Service.MsgEvent(xml, query);
            return new TextResponse("success");
        }
    }
}
